<?php
	/**
	 *	Copyright (c) TeamFlamingo And gray 2004-2009
	 *	www.me-live.com.cn / www.i-gray.cn
	 *
	 *	[ WARNING ]
	 *		This is NOT a freeware!
	 *		You MUST get author's authorization before using it!
	 *	[ WARNING ]
	 *
	 *	Name : sys.inc.php / Development Code Evolve
	 *	Created / Modify : 2010-3-31 / --
	 */

	if( !defined( 'IN_TEAME' ) )
	{
		exit( 'Access Denied' );
	}

	/**
	 *	判断版块信息是否已经缓存
	 */
	if( !file_exists( ME_FORUM_CACHE_FILE ) )
	{
		$row = array();
		$forumResult	=	$db->query( "SELECT * from `mdk_forum`" );
		while( $row[] = $db->assoc( $forumResult ) );
		@file_put_contents( ME_FORUM_CACHE_FILE, "<?php\nif( !defined( 'IN_TEAME' ) )\n{\n\texit( 'Access Denied' );\n}\n\$forumsResult=" . var_export( $row, TRUE ) . ";\n?>" );
	}

	if( !file_exists( ME_FORUM_ADMIN_CACHE_FILE ) )
	{
		$row	=	array();
		$forumUserInfoResult	=	$db->query( "SELECT `a`.`fid`, `m`.`author`, `m`.`uid` FROM `mdk_users` AS `u`, `mdk_member` AS `m`, `mdk_forumadmin` AS `a` WHERE `a`.`adminUid` = `u`.`uid` AND `a`.`adminUid` = `m`.`uid`" );
		while( $row[] = $db->assoc( $forumUserInfoResult ) );
		@file_put_contents( ME_FORUM_ADMIN_CACHE_FILE, "<?php\nif( !defined( 'IN_TEAME' ) )\n{\n\texit( 'Access Denied' );\n}\n\$forumAdmin=" . var_export( $row, TRUE ) . ";\n?>" );
	}
?>